﻿using AfrikDotnetWebSite.Models;
using System.Linq;
using System.Web.Mvc;

namespace AfrikDotnetWebSite.Controllers
{
    public class NewsController : Controller
    {
        AfrikDotnetContext db = new AfrikDotnetContext();

        protected override void Dispose(bool disposing)
        {
            db.Dispose();
            base.Dispose(disposing);
        }

        public ActionResult Index()
        {
            var news = db.News.OrderByDescending(s => s.Date).Take(25);
            return View(news);
        }
    }
}
